<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <meta http-equiv="content-language" content="zh-CN">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit">

    <title>Bilibili_PlayWithMe静态前端测试 - 雪狼七组/ProjectP3：BiLive</title>
    <meta name="author" content="[XL7Z]Ms_KuroNeko">

    <!-- https://github.com/h2non/jshashes -->
    <script src="./Lib/jshashes/hashes.min.js" type="text/javascript"></script>
    <!-- https://github.com/LinusU/decode-utf8 -->
    <script src="./Lib/LinusU/decode-utf8.js" type="text/javascript"></script>
    <!-- https://gitee.com/XL8Z/BiliBili_PlayWithMe_JS -->
    <script src="./PlayWithMe.js" type="text/javascript"></script>
</head>

<body>
    <div id="div_Main">
        <div id="div_TesterOutputer"> </div>
    </div>
</body>

<script src="./DeveloperKey.js" type="text/javascript"></script>


<!-- 插件设置与初始化部分，一定放在最后，不然可能出现需要的JS代码未加载的问题 -->
<script>
    // 设置AppID
    Bilibili_PlayWithMe.AppID = 1651198829890;
    // 手动设置直播间号码，留空将从网页请求参数中取RoomID参数
    Bilibili_PlayWithMe.LiveRoomID = 4639581;

    // 开发者密钥对配置
    // 注意我把Key和Secret放隔壁 DeveloperKey.js 里了，防止直播改代码的时候被截图
    Bilibili_PlayWithMe.Authorizer.DeveloperAccessKey = MyDeveloperAccessKey;
    Bilibili_PlayWithMe.Authorizer.DeveloperAccessSecret = MyDeveloperAccessSecret;
    // 第三方代签服务器端还没上，这几天就到了
    Bilibili_PlayWithMe.Authorizer.RemoteAuthorizerServer = "";

    // 收到新弹幕后会触发下面的 Bilibili_PlayWithMe.NewDanmaku 方法，在这里写你自己的JS代码
    // Dmk 的值如下
    let 弹幕数据样本 = {
        "fans_medal_level": 21,
        "fans_medal_name": "黑喵姐",
        "fans_medal_wearing_status": false,
        "guard_level": 0,
        "msg": "你们谁扔个小心心呗",
        "timestamp": 1650717881,
        "uid": 3102384,
        "uname": "猫裙少年泽远喵",
        "uface": "http://i0.hdslb.com/bfs/face/7ced8612a3f3ef10e7238ee22b4c6948d3f53139.jpg",
        "room_id": 4639581
    };
    Bilibili_PlayWithMe.NewDanmaku = (Dmk) => {
        window.document.getElementById('div_TesterOutputer').innerHTML += Dmk.uname + " 说 " + Dmk.msg + '<hr>';
    }

    // 收到新礼物后会触发下面的 Bilibili_PlayWithMe.NewGifts 方法，在这里写你自己的JS代码
    // Gft 的值如下
    let 礼物数据样本 = {
        "uid": 114439178,
        "uname": "不忘韩文初心",
        "uface": "http://i2.hdslb.com/bfs/face/e549b18085113c6f824c0eefaf2c9d9dcaf5a1d5.jpg",
        "gift_id": 30607,
        "gift_name": "小心心",
        "gift_num": 1,
        "price": 0,
        "paid": false,
        "fans_medal_level": 25,
        "fans_medal_name": "黑喵姐",
        "guard_level": 3,
        "timestamp": 1650717898,
        "anchor_info": {
            "uface": "http://i0.hdslb.com/bfs/face/7ced8612a3f3ef10e7238ee22b4c6948d3f53139.jpg",
            "uid": 3102384,
            "uname": "猫裙少年泽远喵"
        }
    };
    Bilibili_PlayWithMe.NewGifts = (Gft) => {
        window.document.getElementById('div_TesterOutputer').innerHTML += Gft.uname + " 送了 " + Gft.gift_num + " 个 " + Gft.gift_name + '<hr>';
    }

    // 初始化PlayWithMe.js
    let BiliPWM = new Bilibili_PlayWithMe();
    // 向B站回报插件使用情况，不写一样用，但是统计数据会受影响
    BiliPWM.PluginStart();
    // 向B站申请进行WEBSocket长连接，成功了会自动连入
    BiliPWM.PrepareWEBSocketConnection();
    // 执行到这里没问题的话，有弹幕就会自动调用你的代码了
</script>

</html>